package org.jeecg.modules.business.takestockplan.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.business.takestockplan.entity.TakeStockPlanDifferenceMaterial;
import org.jeecg.modules.business.takestockplan.entity.TakeStockPlanExecute;
import org.jeecg.modules.business.takestockplan.entity.TakeStockPlanExecuteMaterial;
import org.jeecg.modules.business.takestockplan.entity.VO.TakeStockPlanExecuteAddVO;
import org.jeecg.modules.business.takestockplan.entity.VO.TakeStockPlanExecuteMaterialVO;
import org.jeecg.modules.business.takestockplan.entity.VO.TakeStockPlanExecuteVO;
import org.springframework.web.multipart.MultipartFile;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Description: 盘点执行
 * @Author: jeecg-boot
 * @Date:   2023-08-04
 * @Version: V1.0
 */
public interface ITakeStockPlanExecuteService extends IService<TakeStockPlanExecute> {

	/**
	 * 分页
	 * @param page
	 * @param takeStockPlanExecute
	 * @return
	 */
	Page<TakeStockPlanExecuteVO> listByPage(Page<TakeStockPlanExecuteVO> page, TakeStockPlanExecuteVO takeStockPlanExecute);

	/**
	 * 获取新增时详情
	 * @param wmsTakeStockPlanId
	 * @return
	 */
	TakeStockPlanExecuteMaterialVO getAddDetail(String wmsTakeStockPlanId);

	/**
	 * 新增
	 * @param vo
	 */
	String saveExecute(TakeStockPlanExecuteAddVO vo);

	/**
	 * 编辑
	 * @param vo
	 */
	void updateExecute(TakeStockPlanExecuteAddVO vo);

	/**
	 * 通过id查询
	 * @param id
	 * @return
	 */
	TakeStockPlanExecuteMaterialVO getExecuteById(String id);

	/**
	 * 删除一对多
	 *
	 * @param id
	 */
	public void delMain (String id);

	/**
	 * 生成盘盈盘亏单
	 * @param id
	 */
	void addTakeStockResult(String id);

	/**
	 * 复盘
	 * @param id
	 * @param result
	 */
	String replay(String id, List<String> result);

	/**
	 * 盘点分析分页
	 * @param page
	 * @param takeStockPlanExecute
	 * @return
	 */
	Page<TakeStockPlanExecuteVO> pageAnalysis(Page<TakeStockPlanExecuteVO> page, TakeStockPlanExecuteVO takeStockPlanExecute);

	/**
	 * 盘点对比
	 * @param takeStockPlanId
	 * @return
	 */
	TakeStockPlanExecuteMaterialVO contrast(String takeStockPlanId);

	/**
	 * 保存盘点对比
	 * @return
	 */
	void saveContrast(List<TakeStockPlanExecuteMaterial> list);

	/**
	 * 盘点差异处理
	 * @param takeStockPlanId
	 * @return
	 */
	TakeStockPlanExecuteMaterialVO difference(String takeStockPlanId);

	/**
	 * 根据物料查询账存数量
	 * @return
	 */
	BigDecimal getStockQuantity(TakeStockPlanExecuteMaterial material);

	/**
	 * 导入物料明细
	 * @return
	 */
	Result<List<TakeStockPlanDifferenceMaterial>> importExcel(MultipartFile file, String id);
}
